import type { NextApiResponse } from 'next';
import * as categoryService from '@/common/service/g_category';
import { AuthenticatedRequest, withAuth } from '@common/middleware/auth';

export async function handler(req: AuthenticatedRequest, res: NextApiResponse) {
  const { _start = 0, _end = 10 } = req.query;
  const data = await categoryService.getCategoryList({}, Number(_start), Number(_end));
  res.status(200).json({ success: true, data });
}

export default withAuth(handler,{GET:'project:category:list'}); 